<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title><if condition="$action eq 'true_false'">真伪查询<else/>申请查询</if></title>
    <link rel="stylesheet" href="__VENDOR__/css/head.css">
    <link rel="stylesheet" href="__VENDOR__/css/foot.css">
    <link rel="stylesheet" href="__VENDOR__/css/demand.css">
    <script src="__VENDOR__/js/jquery-1.12.2.js"></script>
    <script src="__VENDOR__/js/ajax.js"></script>
    <script type="text/javascript" src="__VENDOR_ADMIN__/lib/layer/2.4/layer.js"></script>
</head>
<body style="background: #f6f6f6">
<div class="head">
    <div class="head_div">
        <img style="float: left;display: block;margin-top: -10px" src="/Public/Home/extend/img/banner1.jpg" alt="">
        <div class="fl">
            <span>湖州交警支队在线审批</span>
            <span>http://www.hzjxj.com</span>
        </div>
        <div class="fr">
            <ul>
                <li><a href="/Home/Index/index.html">审批主页</a></li>
                <li><a href="/Home/Index/process.html">流程查询</a></li>
                <li><a href="/Home/Index/project.html" >项目申请</a></li>
                <li><a href="/Home/Index/apply_for.html" <if condition="$action eq 'apply_for'">class="hover"</if>>申请查询</a></li>
                <li><a href="/Home/Index/true_false.html" <if condition="$action eq 'true_false'">class="hover"</if>>真伪查询</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="demand_content">
    <div class="demand_div">
        <div class="demand_div1">
            <img src="__VENDOR__/img/1.jpg" alt="">
            <span><if condition="$action eq 'true_false'">真伪查询<else/>申请查询</if></span>
        </div>
    </div>
    <div class="demand_div2">
        <span>申请时间：{{:date("Y-m-d H:i:s",$res['apply_time'])}}</span>
    </div>
    <div class="demand_div3">
        <p>查询编号：<span>{{$res['number']}}</span></p>
        <p>当前状态：
            <span>
                <switch name="res['status']">
                    <case value="1">等待受理</case>
                    <case value="2|3|4">已受理</case>
                    <case value="5">审批完成</case>
                    <case value="6">申请被拒</case>
                    <case value="7">已取消</case>
                </switch>
            </span>
        </p>
        <switch name="res['status']">
            <case value="1|2|3|4"><p class="demand_div3_p">剩余时间：<span class="demand_div3_span" style="<if condition="$res['last_time'] eq '已超出'">color:red</if>">{{$res['last_time']}}</span></p></case>
            <case value="5"><p class="demand_div3_p">耗时：<span class="demand_div3_span">{{$res['last_time']}}</span></p></case>
            <case value="6"><p class="demand_div3_p">处理时间：<span class="demand_div3_span">{{:date("Y-m-d H:i:s",$res['accept_time'])}}</span></p></case>
            <case value="7"><p class="demand_div3_p">取消时间：<span class="demand_div3_span">{{:date("Y-m-d H:i:s",$res['cancel_time'])}}</span></p></case>
        </switch>
    </div>


    <switch name="res['status']">
        <case value="5"><!--审批完成-->
            <div class="download">
                <p>下载表格 : <span>{{$res['number']}}.pdf</span></p>
                <a title="点击下载" style="color: #063892;text-decoration: none;margin-left: 30px" href="{{:U('Home/Data/getComplete',array('id'=>$res['id']))}}" >
                    <span class="sp" style="background: #ff6464">    点击下载</span>
                </a>
                <if condition="$res['need_deliver'] eq 1">
                    <p style="float:right;width: 40%;margin-top:10px">材料快递单号：<span>{{$res['deliver_tracking']}}</span></p>
                </if>
            </div>
        </case>
        <case value="6">  <!--申请被拒-->
            <div class="reason">
                <p>被拒理由：<span>{{$res['refuse_reason']}}</span></p>
            </div>
            <div class="demand_inp">
                <span style="background: #ff6464"><a href="javascript:void(0)" onclick="cancel_apply({{$res['id']}})">取消申请</a> </span>
                <span style="background: #1f5cc8"> <a href="{{:U('Home/Index/project')}}">重新申请</a></span>
                <span style="background: #ff8c47"><a href="javascript:void(0)" onclick="supplement({{$res['id']}})">补充材料</a></span>
            </div>
        </case>
    </switch>

    <div class="demand_div5">
        <span> <a href="{{:U('Home/Index/index')}}">退出查询</a> </span>
        <!--等待受理-->
    </div>
    <form action="{{:U('Home/Index/supplement')}}" method="post"  id="applyform">
        <input type="hidden" id="apply_id" name="apply_id"/>
    </form>
</div>
<div id="foot"></div>
</body>
<script type="text/javascript">
    function cancel_apply(id){
        $.ajax({
            type: 'POST',
            url: '{{:U("Home/Ajax/cancelApply")}}',
            data: {
                apply_id:id,
            },
            dataType: 'json',
            success: function(data){
                if(data.status){
                    layer.msg(data.info,{icon:6,time:1000});
                    setTimeout((function () {
                        window.location.href="{{:U('Home/Index/index')}}";
                    }), 1500);

                }else{
                    layer.msg(data.info,{icon:2,time:1000});
                }
            },
            error:function(data) {
                console.log(data.msg);
            },
        });
    }

    function supplement(id){
        $("#apply_id").val(id);
        $("#applyform").submit();
    }

    $(function(){});
</script>
</html>